<%-- 
    Document   : new_visit
    Created on : May 27, 2013, 3:38:33 PM
    Author     : Mansur
--%>

<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>.: Ship Visit :.</title>    
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.blockUI.js"></script>   
        <script type="text/javascript">
            $(function() {
                $("#datepicker2").datepicker({
                    showOn: "button",
                    buttonImage: "${pageContext.request.contextPath}/images/icon/calendar.gif",
                    buttonImageOnly: true,
                    changeMonth: true,
                    dateFormat: 'dd/mm/yy',
                    changeYear: true                    
                });
            });
            
            function clear(){
//                document.form1.
            }
            
            function unblockUI() {
                $.unblockUI();
            }
            
            function blockUI () {
                $.blockUI();
            }
            
            function popupWin(id) {
                var url = '${pageContext.request.contextPath}/shipVisit?viewDoc&idVisit=' + id;
                var left = (screen.width/2)-(1000/2);
                var top = (screen.height/2)-(1000/2);                
                var params = 'width=1000';
                params += ', height=1000';
                params += ', top=' + top;
                params += ', left=' + left;
                //params += ', fullscreen=yes';
                params += ', directories=no';
                params += ', location=no';
                params += ', menubar=no';
                params += ', resizable=no';
                params += ', scrollbars=yes';
                params += ', status=no';
                params += ', toolbar=no';                
                newwin = window.open(url, 'PopUp', params);
                if (window.focus) {
                    newwin.focus();
                }                
                return false;
            }
        </script>
    </head>
    <body>
        <s:messages/>
        <s:errors/>
        <s:useActionBean beanclass="exatrez.stripes.util.ListUtil" var="list"/>
        <s:form beanclass="exatrez.stripes.action.ShipVisitAction" name="form1">               
            <div>
                <fieldset>
                    <div id="page-title">
                        <span class="title">Search Staff Ship Visit : Details</span>
                    </div>
                    <s:submit name="mainStaffVisit" value="Back" class="btn"/>
                    <div style="align: center">
                        <span class="sub-title">Ship visit target as per year ${actionBean.currentYear}</span>
                        <display:table class="tablecloth" name="${actionBean.listCounter}" requestURI="/shipVisit" id="line" style="width:80%">
                            <display:column title="Department">${line.user.department.departmentName}</display:column>
                            <display:column title="User ID" property="user.userId"/>
                            <display:column title="Target Visit" property="target"/>
                            <display:column title="No. of visit" property="visited"/>
                            <display:column title="Total Balance"><c:out value="${line.target - line.visited}" /></display:column>                 
                        </display:table>
                    </div>
                    <div id="page-title">
                        <span class="title">History Ship Visited as per year ${actionBean.currentYear}</span>
                    </div>
                    <div>
                        <display:table class="tablecloth" name="${actionBean.listShipVisit}" requestURI="/shipVisit?viewListVisit" id="line" >
                            <display:column title="No." sortable="true" ><center>${line_rowNum}.</center></display:column>
                            <display:column title="Vessel Name" sortable="true" property="vessel.vesselName" />
                            <display:column title="Date Visit" sortable="true" ><fmt:formatDate value="${line.dateVisit}" pattern="dd/MM/yyyy"/></display:column>
                            <display:column title="Location" sortable="true" property="location"/>        
                            <display:column title="Description" sortable="true" property="description"/> 
                            <display:column title="Upload" >
                                <c:if test="${!empty(line.fileList)}" >
                                    <a href="#" onclick="popupWin('${line.shipVisitId}');return false;">View</a>
                                </c:if>
                            </display:column>
                        </display:table>
                    </div>
                    <s:submit name="mainStaffVisit" value="Back" class="btn"/>
                </fieldset>
            </div>
        </s:form>
    </body>
</html>
